<!--
	整个管理页模板框架
-->
<template>
	<el-container>
		<el-aside style="transition: all .5s" width="200px">
			<lzk-logo/>  <!-- logo -->
			<lzk-menu :menus="menus" />  <!-- 菜单 -->
		</el-aside>
		<el-container>
			<el-header>
				<lzk-header :menus="menus" :route-path="this.$route.path" />  <!-- header 头部 -->
			</el-header>
			<el-main>
				<router-view/>
			</el-main>
		</el-container>
	</el-container>
</template>

<script>
import Menu from "@/components/frame/Menu";
import Header from "@/components/frame/Header";
import Logo from "@/components/frame/Logo";
import axios from "@/plugins/axios";
import ipconfig from "@/utils/ipconfig";
import roleHelper from "@/utils/roleHelper";

export default {
	name: "FrameIndex",
	/*
	* 参数
	* @param roleId -- 角色Id
	* */
	props:["roleId"],
	components:{
		"lzk-menu":Menu,
		"lzk-header":Header,
		"lzk-logo":Logo,
	},
	data(){
		return {
			/**
			 * 菜单数据
			 */
			menus:[]
		}
	},
	created() {
		// 判断角色来加载菜单数据
		// 加载菜单数据
		axios.get(ipconfig.selfAddress+roleHelper.getRequestPathStringByRoleId(this.roleId)).then((response)=>{
			this.menus=response.data;
		}).catch((error)=>{
			console.log(error);
		});

	}

}
</script>

<style lang="scss" scoped>

</style>